<div class="page company">
    <div class="action-bar">
        <div class="row">
            <div class="col-sm-8">
                <form>
                    <div class="row">
                        <div class="col-sm-4">
                            <ui-select ng-model="content.skuClass" theme="bootstrap" onfocus="false"
                                       on-select="selectSkuClass($select.selected);" required>
                                <ui-select-match placeholder="选择分类">{{$select.selected.classDescription}}</ui-select-match>
                                <ui-select-choices
                                        repeat="sc in skuClasses | filter: $select.search">
                                    <div ng-bind-html="sc.classDescription | highlight: $select.search"></div>
                                </ui-select-choices>
                            </ui-select>
                        </div>
                        <div class="col-sm-4">
                            <input type="text" class="form-control"
                                   placeholder="请输入查询条件"
                                   ng-model="query"/>
                        </div>
                        <div class="col-sm-4">
                            <button class="btn btn-primary" ng-click="searchMaterials()">
                                查询
                            </button>
                        </div>
                    </div>
                </form>
            </div>
            <div class="col-sm-4">
                <button class="btn btn-success pull-right" ng-click="addMaterial()" btn-auth="material.post">
                    增加物料
                </button>
            </div>
        </div>
    </div>
</div>

<div class="panel page-content">
    <div ng-if="materials.length<=0" class="nodata"></div>
    <table class="table table-hover" ng-if="materials.length>0">
        <thead>
        <tr>
            <th>SAP号</th>
            <th>物料分类</th>
            <th>物料号</th>
            <th>物料描述</th>
            <th>英文名</th>
            <th>包装方式</th>
            <th>包装尺寸</th>
            <th>重量</th>
           <!-- <th>简写</th>
            <th>毛重</th>
            <th>净重</th>-->
            <th class="text-right">操作</th>
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="material in materials">
            <td>
                {{material.sku}}
            </td>
            <td>{{material.skuClass}}</td>
            <td>
                {{material.packCode}}
            </td>

            <td>{{material.skuName}}</td>
            <td>{{material.englishName}}</td>
            <td>{{material.packMethod}}</td>
            <td>{{material.packSize}}</td>
            <td>{{material.packWeight}}</td>
           <!-- <td>{{material.shortName}}</td>
            <td>{{material.grossWeight}}</td>
            <td>{{material.netWeight}}</td>-->
            <td class="text-right" width="160">
                <button class="btn btn-primary btn-md mr10" ng-click="updateMaterial(material)" btn-auth="material.post">编辑</button>
                <button class="btn btn-danger btn-md" ng-click="deleteMaterial(material)" btn-auth="material.delete">删除</button>
            </td>
        </tr>
        </tbody>
    </table>

    <div class="text-center">
        <pagination total-items="pager.totalItems" ng-model="pager.pageNo"
                    ng-if="pager.totalItems>pager.pageSize"
                    items-per-page="pager.pageSize" ng-change="getMaterials()"
                    previous-text="上一页" next-text="下一页" max-size="3"></pagination>
    </div>
</div>




